gtk/main: Do not unset active state on button release w/o implicit grab
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Nov 2020 19:12:58 +0000 (20:12 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Nov 2020 21:58:14 +0000 (22:58 +0100)
commit5ab14ff7f62baac591cbf44b6af63e44446c3f1e
tree2375afaeffe6e1fc7ee37343015bed8e8253a189
parent8482b956d697e74d62a968586e7a7a3c7ed03ec6
gtk/main: Do not unset active state on button release w/o implicit grab

If an active grab gets undone on button press (e.g. closing a menu), we
will receive a button release on the new target even though it didn't handle
the button press, and disable ::active state.

This causes warnings when handling the button release, as it tries to undo
::active state that is not really there.

In order to fix this, check that the pointer focus actually had an implicit
grab at the time of receiving the button release, before trying to unset
the ::active state.
gtk/gtkmain.c